<template>
  <WindowDialog v-model:visible="show" :title="`${eventType ? (eventType === '0' ? '关注' : '报警') : ''}事件统计`" @close="close">
    <component v-bind:is="name" @change="changeCard" :eventType="eventType" />
  </WindowDialog>
</template>

<script>
  import TableCard from './table.vue';
  import ChartsCard from './charts.vue';
  import WindowDialog from '/@/components/windowDialog/index.vue';
  export default {
    components: { TableCard, ChartsCard, WindowDialog },
    data() {
      return {
        name: '',
        show: false,
        eventType: '',
      };
    },
    methods: {
      changeCard(name) {
        this.name = name;
      },
      open(val) {
        this.eventType = val; // 关注0 报警 1
        this.name = 'TableCard';
        this.show = true;
      },
      close() {
        this.name = '';
      },
    },
  };
</script>

<style></style>
